package org.op.service.doc;

import java.util.List;

import javax.swing.text.Document;

public interface DocumentConversionService {

	/**
	 *  Converts an array of strings into a Document object
	 *  
	 * @param content
	 * @return
	 * @throws Exception
	 */
	public Document textToDocument(List<String> content) throws Exception;
	
	/**
	 *  Converts the document into an array of strings for persistence
	 * 
	 * @param document
	 * @return
	 * @throws Exception
	 */
	public List<String> documentToText(Document document) throws Exception;
	
	/**
	 *   Inserts a line of text to the current document (at the given point)
	 *   
	 * @param doc
	 * @param line
	 * @return
	 * @throws Exception
	 */
	public Document insertLineIntoDocument(Document doc, String line, int insertionPoint) throws Exception; 
	
	/**
	 *  Utility method for converting document text into a list 
	 *  
	 * @param text
	 * @return
	 */
	public List<String> textToList(String text);
	
}
